package com.sample.mapping;

import java.util.LinkedHashMap;

import javax.persistence.Column;

//dynamic column column name userid comment are string
public class PostCommentsMapping<T> extends AbstractMapping<T>{

	@Column(name = "generateTimeId")
	private LinkedHashMap<T,T> commentMap;

	public LinkedHashMap<T,T> getMap() {
		return commentMap;
	}

	public void setMap(LinkedHashMap<T,T> map) {
		this.commentMap = map;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((commentMap == null) ? 0 : commentMap.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		PostCommentsMapping other = (PostCommentsMapping) obj;
		if (commentMap == null) {
			if (other.commentMap != null)
				return false;
		} else if (!(commentMap.size()== other.getMap().size()))
			return false;
		return true;
	}

	
}
